#include<bits/stdc++.h>
using namespace std;
namespace my_std{
	#define ll long long
	#define bl bool
	ll my_pow(ll a,ll b,ll mod){
		ll res=1;
		if(!b) return 1;
		while(b){
			if(b&1) res=(res*a)%mod;
			a=(a*a)%mod;
			b>>=1;
		}
		return res;
	}
	ll qpow(ll a,ll b){
		ll res=1;
		if(!b) return 1;
		while(b){
			if(b&1) res*=a;
			a*=a;
			b>>=1;
		}
		return res;
	}
	#define db double
	#define pf printf
	#define pc putchar
	#define fr(i,x,y) for(register ll i=(x);i<=(y);i++)
	#define pfr(i,x,y) for(register ll i=(x);i>=(y);i--)
	#define go(u) for(ll i=head[u];i;i=e[i].nxt)
	#define enter pc('\n')
	#define space pc(' ')
	#define fir first
	#define sec second
	#define MP make_pair
	#define il inline
	#define inf 8e18
	#define random(x) rand()*rand()%(x)
	#define inv(a,mod) my_pow((a),(mod-2),(mod))
	il ll read(){
		ll sum=0,f=1;
		char ch=0;
		while(!isdigit(ch)){
			if(ch=='-') f=-1;
			ch=getchar();
		}
		while(isdigit(ch)){
			sum=sum*10+(ch^48);
			ch=getchar();
		}
		return sum*f;
	}
	il void write(ll x){
		if(x<0){
			x=-x;
			pc('-');
		}
		if(x>9) write(x/10);
		pc(x%10+'0');
	}
	il void writeln(ll x){
		write(x);
		enter;
	}
	il void writesp(ll x){
		write(x);
		space;
	}
}
using namespace my_std;
multiset<pair<ll,ll> > s;
ll n,m,q,a[150015],d[150015];
struct BIT{
	ll tree[150015];
	il ll lowbit(ll x){
		return x&(-x);
	}
	il void mdf(ll x,ll v){
		while(x<=n){
			tree[x]+=v;
			x+=lowbit(x);
		}
	}
	il ll query(ll x){
		ll res=0;
		while(x){
			res+=tree[x];
			x-=lowbit(x);
		}
		return res;
	}
}T;
struct sub{
	vector<ll> vec[150015],ins[150015];
	pair<ll,ll> p[150015];
	ll sum[150015],ans[150015];
	void solve(){
		fr(i,1,n) d[i]=a[i]-a[i-1];
		fr(i,1,n) sum[i]=sum[i-1]+d[i]*(i/m);
		fr(i,1,q){
			ll l=read(),r=read();
			ans[i]=a[r]*((r+1)/m);
			ans[i]-=sum[r]-sum[l];
			ans[i]-=a[l]*(l/m);
			p[i]=MP(l,r);
			vec[(r+1)%m].push_back(i);
		}
		fr(i,1,n) ins[i%m].push_back(i);
		fr(i,0,m-1){
			fr(j,0,(ll)vec[i].size()-1){
				ll id=vec[i][j],l=p[id].fir,r=p[id].sec;
				if(l%m<i) ans[id]+=a[l];
				ans[id]+=T.query(r)-T.query(l);
			}
			fr(j,0,(ll)ins[i].size()-1){
				ll pos=ins[i][j];
				T.mdf(pos,d[pos]);
			}
		}
		fr(i,1,q) writeln(ans[i]);
	}
}sub;
int main(){
	freopen("clear.in","r",stdin);
	freopen("clear.out","w",stdout);
	n=read();
	m=read();
	q=read();
	fr(i,1,n) a[i]=read();
	bl ck=0;
	fr(i,1,n) if(a[i-1]>a[i]) ck=1;
	if(!ck){
		sub.solve();
		return 0;
	}
	fr(i,1,q){
		ll l=read(),r=read(),len=r-l+1;
		d[1]=a[l];
		d[len+1]=-a[r];
		fr(j,2,len) d[j]=a[l+j-1]-a[l+j-2];
		ll ans=0;
		fr(j,1,len+1){
			if(d[j]>0) ans+=d[j]*(1-j/m);
			else ans-=d[j]*(j/m);
		}
		fr(j,1,len+1){
			if(d[j]>0){
				s.insert(MP(j%m,d[j]));
				continue;
			}
			set<pair<ll,ll> >::iterator it=s.lower_bound(MP(j%m,0));
			while(d[j]<0&&it!=s.end()){
				pair<ll,ll> now=*it;
				s.erase(s.find(now));
				ll tmp=min(-d[j],now.sec);
				d[j]+=tmp;
				now.sec-=tmp;
				ans-=tmp;
				if(now.sec) s.insert(now);
				it=s.lower_bound(MP(j%m,0));
			}
			it=s.begin();
			while(d[j]<0){
				pair<ll,ll> now=*it;
				s.erase(s.find(now));
				ll tmp=min(-d[j],now.sec);
				d[j]+=tmp;
				now.sec-=tmp;
				if(now.sec) s.insert(now);
				it=s.begin();
			}
		}
		writeln(ans);
		s.clear();
	}
}
